<?php

class Index extends CI_Controller
{
    
    function __construct() {
        parent::__construct();
    }
    function index()
    {
//        log_message("error","entre a indez");
        
        
        $data['breadcumb'] = "Cursos Inscritos";
        $data['user'] = $this->session->userdata('user_id');
        $data['member_name'] = $this->session->userdata('nombre');
        $data['avatar'] = $this->session->userdata('avatar');
        $data['rol'] = $this->session->userdata('id_perfil');
        $banner['module_name'] = 'Bienvenido a SACC';
        $banner['module_description'] = utf8_encode('Sistema de administraci&oacute;n de Congregaciones Cristianas');
        $data['module_banner'] = $this->load->view('/include/sections/module_banner/module_title',$banner,true);
        $data['page_title'] = "PCG";
        
        $groups = $this->session->userdata('groups');
        
        
        
        $modules = array();
        //cargamos modulos por grupo
        foreach($groups as $g){
            $modules[$g->groups_id] = $this->auth_model->getModulesByGroup($g->groups_id);
        }
        
        $data['groups'] = $groups;
        $data['modules'] = $modules;
        
        
        $this->layout->view('/index/index', $data);
    }
}